package org.systm.menu.params;

import lombok.*;
import net.minidev.json.annotate.JsonIgnore;
import org.global.basic.tree.TreeItem;
import org.global.utils.Copy;
import org.systm.menu.entity.MenuType;
import org.systm.menu.entity.PageMeta;

import java.util.List;

/**
 * 展示出去的数据
 */

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ExhibitMenu implements TreeItem<ExhibitMenu> {
    @Copy
    private String id;
    private String path;
    private String redirect;
    private String pid;
    private int sort;
    private MenuType menuType;
    private String name;
    private String component;
    @Copy
    private PageMeta meta;
    private List<ExhibitMenu> child;
    private boolean del;

    @Override
    @JsonIgnore
    public List<ExhibitMenu> children() {
        return child;
    }

    @Override
    @JsonIgnore
    public void setChildren(List<ExhibitMenu> children) {
        this.child = children;
    }

    @Override
    @JsonIgnore
    public int sort() {
        return this.sort;
    }
}
